public class text4 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 5, 9, 40, 56, 89, 65, 99};
        int max = getMax(arr);
        System.out.println(max);
    }
    public static int getMax(int[] arr) {
        int max =arr[0];
        for (int i = 1; i < arr.length; i++) {
            if(arr[i] > max){
                max = arr[i];
            }
        }
        return max;
    }
}
